<SCRIPT>
function updateScore() {
	
        var score1=0.00;
        var score2=0.00;
        var score3=0.00;
        var score4=0.00;
	notaApro=parseFloat(document.getElementById("CiucourseCiustudentNotaaprobatoria").value);
        
        score1=parseFloat(document.getElementById("CiucourseCiustudentScore1").value);
        score1=getNum(score1);
        
        score2=parseFloat(document.getElementById("CiucourseCiustudentScore2").value);
        score2=getNum(score2);
        
        score3=parseFloat(document.getElementById("CiucourseCiustudentScore3").value);
        score3=getNum(score3);
        
        score4=parseFloat(document.getElementById("CiucourseCiustudentScore4").value);
        score4=getNum(score4);
        
        calc=parseFloat((score1+score2+score3+score4)/4);
        document.getElementById("CiucourseCiustudentTotalScore").value = calc.toFixed(1);

        if ( notaApro <= calc.toFixed(1) ){
         document.getElementById("CiucourseCiustudentCiucurspersstateId").value = 4;
        }else if ( notaApro > calc.toFixed(1) ){
         document.getElementById("CiucourseCiustudentCiucurspersstateId").value = 5;
        }
}
function getNum(val)
{
   if (isNaN(val)) 
     return 0;
   else
     return val;
}
</SCRIPT>